const Store = require('electron-store')

class DataStore extends Store {
    constructor(settings) {
        super(settings)
        this.tracks = this.get("tracks") || []
    }
    saveTracks() {
        this.set("tracks", this.tracks)
        return this
    }
    getTracks() {
        return this.get("tracks") || []
    }
    addTracks(track) {
        this.tracks = this.tracks.push(track)
        return this.saveTracks()
    }
}

module.exports = DataStore